﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using NUnit.Framework;
using CondominioG1.Persistencia.NHibernate;
using CondominioG1.Dominio;
using CondominioG1.Negocio;

using Spring.Context;
using Spring.Context.Support;


namespace CondominioG1.Pruebas.TestService
{
            [TestFixture]

    public class TestCuotaService
    {


        private IApplicationContext Spring;

        [TestFixtureSetUp]
        public void InicializarPruebas()
        {
            //"assembly://assembly/namespace/capaPersistencia.xml",
            Spring = new XmlApplicationContext(
                "assembly://CondominioG1/CondominioG1/capaPersistencia.xml",
                "assembly://CondominioG1/CondominioG1/capaNegocio.xml"
                );
        }

        [Test]
        public void TestPagarCuota()
        {
            //ReservaService reservaService = new ReservaService();
            CuotaService cuotaService = (CuotaService)Spring.GetObject("cuotaService");
            Assert.NotNull(cuotaService);
            Cuota cuota = null;
            Assert.DoesNotThrow(delegate
            {
                cuota = cuotaService.PagarCuota("0001");
            });
            Assert.NotNull(cuota);
            Assert.Greater(cuota.Numero, 0);

        }
    }
}